Winter 2026 Day 6
Batch Scheduling
Interactive Scheduling
Average waiting time: \[[(10-4) + 4 + 7] = 17/3 = 5.66\]
Pros:
Cons?
Process Burst Time
P1 24
P2 3
P3 3
Quantum = 4
All have downsides
Those that optimize turnaround / wait, can harm response time
Those that optimize response time, can harm turnaround, wait
What should we do?
Rule 1: If Priority(A) > Priority(B), A runs (B doesn’t)
Rule 2: If Priority(A)=Priority(B), A & B run in RR
Rule 3: When a job enters the system, it is placed at the highest priority (the topmost queue)
Rule 4a: If a job uses up its allotment while running, its priority is reduced (i.e., it moves down one queue)
Rule 4b: If a job gives up the CPU (for example, by performing an I/O operation) before the allotment is up, it stays at the same priority level (i.e., its allotment is reset)
Any problems with these???
vruntime (how long any process has run): lowest vruntime runs nextsched_latency by # processes to determine a dynamic quantum (floor set by min_granularity)
vruntime) to runWhat isn’t clear?
Comments? Thoughts?
fork() and threadingfork()?What isn’t clear?
Comments? Thoughts?
pthread*
create, exit, yield, join (Look familiar?)What isn’t clear?
Comments? Thoughts?